package org.tbjd.client.customWidgets.taskList;

import com.google.gwt.user.client.ui.FocusListener;
import com.google.gwt.user.client.ui.FocusPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;

public class TreeGridItemHandel extends FocusPanel{
	
	HorizontalPanel container = null;
	FocusPanel handlePanel = null;
	TextBox textBox = new TextBox();
	
	public TreeGridItemHandel(){}
	
	public TreeGridItemHandel(String value){
		
		container = new HorizontalPanel();
		handlePanel = new FocusPanel();
		
		handlePanel.add(new HTML("<li>&nbsp;</li>"));
		
		handlePanel.addFocusListener(new FocusListener(){

			public void onFocus(Widget sender) {
				System.out.println("Handle.focus() - " + textBox.getText() + " focus");
			}

			public void onLostFocus(Widget sender) {
				System.out.println("Handle.onLostFocus() - " + textBox.getText() + " lost focus");
			}
			
		});
		
		container.add(handlePanel);
		
		textBox.setText(value);
		textBox.setStyleName("customTextBox");
		container.add(textBox);
		
		container.setBorderWidth(0);
		
		this.add(container);
		
	}
	
	public FocusPanel getHandel(){
		return handlePanel;
	}
	
}
